package com.cjyd.hrjb.controller;

import com.cjyd.hrjb.model.dto.ResponseDto;
import com.cjyd.hrjb.utils.ResponseUtil;
import com.cjyd.hrjb.utils.ResultCode;
import org.springframework.web.bind.annotation.CrossOrigin;

/**
 * Created fei wo by 2020/4/5
 */
@CrossOrigin("*")
public class BaseController {

    protected <T> ResponseDto<T> success(T data) {
        return ResponseUtil.success(data);
    }

    protected ResponseDto<Void> success() {
        return ResponseUtil.success();
    }

    protected ResponseDto<Void> error(ResultCode resultCode) {
        return ResponseUtil.error(resultCode);
    }

    protected ResponseDto<Void> systemError() {
        return ResponseUtil.sysError();
    }
}
